import { S } from '../../s';
import { IPSDECMGroupItem } from './ipsdecmgroup-item';
import { IPSDEContextMenuItem } from './ipsdecontext-menu-item';
import { IPSDETBGroupItem } from './ipsdetbgroup-item';
import { IPSDEToolbarItem } from './ipsdetoolbar-item';
import { PSDEToolbarItemImpl } from './psdetoolbar-item-impl';

export class PSDETBGroupItemImpl
  extends PSDEToolbarItemImpl
  implements IPSDETBGroupItem, IPSDECMGroupItem
{
  protected psdecontextmenuitems: IPSDEContextMenuItem[];
  getPSDEContextMenuItems(): IPSDEContextMenuItem[] | null {
    return (
      this.psdecontextmenuitems ||
      (this.psdecontextmenuitems = this.fillChildListModel(
        this.M.getPSDEContextMenuItems,
        S._1a0,
      ) as IPSDEContextMenuItem[])
    );
  }

  findPSDEContextMenuItem(objKey: any): IPSDEContextMenuItem | null {
    return this.getPSModel5(
      S._1a0,
      this.getPSDEContextMenuItems(),
      objKey,
    ) as IPSDEContextMenuItem;
  }

  protected psdetoolbaritems: IPSDEToolbarItem[];
  getPSDEToolbarItems(): IPSDEToolbarItem[] | null {
    return (
      this.psdetoolbaritems ||
      (this.psdetoolbaritems = this.fillChildListModel(
        this.M.getPSDEToolbarItems,
        S._1a1,
      ) as IPSDEToolbarItem[])
    );
  }

  findPSDEToolbarItem(objKey: any): IPSDEToolbarItem | null {
    return this.getPSModel5(
      S._1a1,
      this.getPSDEToolbarItems(),
      objKey,
    ) as IPSDEToolbarItem;
  }

  get valid(): boolean {
    return this.M.valid != null ? this.M.valid : true;
  }
  get cls(): string {
    return 'PSDETBGroupItemImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1a2 || cls == S._1a3) return true;
    return super.instanceof(cls);
  }
}
